import os

class DirUtil:
    def __init__(self):
        pass

    @classmethod
    def deleteByDir(cls,dir,type=""):
        for files in os.listdir(dir):
            if type != "":
                if files.endswith(".py"):
                    os.remove(os.path.join(dir, files))
            else:
                os.remove(os.path.join(dir, files))